<%--
  Created by IntelliJ IDEA.
  User: 494418174
  Date: 2020/3/9 0009
  Time: 11:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body style="height: 100%; margin: 0">
<div id="container" style="height: 90%;margin-top: 20px;"></div>

<script type="text/javascript" src="/js/echarts.min.js"></script>
<script type="text/javascript" src="/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript">

    var dom = document.getElementById("container");
    var myChart = echarts.init(dom);
    var app = {};

    $(function () {
        $.post("/stat/findCustomerAddress",function (r) {
            var data = r.data
            option = null;
            option = {
                title: {
                    text: '客户地区统计',
                    subtext: '真实有效',
                    left: 'center'
                },
                tooltip: {
                    trigger: 'item',
                    formatter: '{a} <br/>{b} : {c} ({d}%)'
                },
                legend: {
                    orient: 'vertical',
                    left: 'left',
                    data:  data
                },
                series: [
                    {
                        name: '客户数量（占比）',
                        type: 'pie',
                        radius: '55%',
                        center: ['50%', '60%'],
                        data: data,
                        emphasis: {
                            itemStyle: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                    }
                ]
            };
            ;
            if (option && typeof option === "object") {
                myChart.setOption(option, true);
            }
        })
    })



</script>
</body>
</html>
